package lec11greedy;

import java.util.Arrays;
import java.util.Scanner;

public class K0 {//TLE
    static Scanner cin = new Scanner(System.in);

    public static void main(String[] args) {
        int[] a = new int[10000000];

        int n = cin.nextInt();
        while (n-- > 0) {
            int start = cin.nextInt();
            int end = cin.nextInt();
            for (int x = start; x <= end; x++)
                ++a[x];
        }

        Arrays.sort(a);
        System.out.println(a[a.length - 1]);


        cin.close();
    }


}
